Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
tsparticles
Advanced tools
Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.
A lightweight TypeScript library for creating particles. Dependency free (*), browser ready and compatible with React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.js, Solid.js, and Web Components
Documentation and Development references here 📖
This library is available on the two most popular CDNs and it's easy and ready to use, if you were using particles.js it's even easier.
You'll find the instructions below, with all the links you need, and don't be scared by TypeScript, it's just the source language.
The output files are just JavaScript. 🤩
CDNs and npm
have all the sources you need in Javascript, a bundle browser ready (tsparticles.min.js) and all
files splitted for import
syntax.
If you are interested there are some simple instructions just below to guide you to migrate from the old particles.js library.
Please use this hosts or your own to load tsParticles on your projects
https://unpkg.com/tsparticles/
npm install tsparticles
yarn add tsparticles
Starting from version 1.12.11 import
and require
can be used to import tsParticles
.
Now you can write something like this
const tsParticles = require("tsparticles");
// or
import { tsParticles } from "tsparticles";
The imported tsParticles
is the same instance you have when including the script.
Load tsParticles and configure the particles:
index.html
<div id="tsparticles"></div>
<script src="tsparticles.min.js"></script>
app.js
// @path-json can be an object or an array, the first will be loaded directly, the object from the array will be random selected
/* tsParticles.loadJSON(@dom-id, @path-json, @callback (optional)); */
tsParticles
.loadJSON("tsparticles", "presets/default.json")
.then((container) => {
console.log("callback - tsparticles config loaded");
})
.catch((error) => {
console.error(error);
});
//or
/* tsParticles.load(@dom-id, @options); */
tsParticles.load("tsparticles", {
/* options here */
});
//or
/* tsParticles.loadFromArray(@dom-id, @options, @index (optional)); */
tsParticles.loadFromArray("tsparticles", [
{
/* options here */
},
{
/* other options here */
},
]);
//random object
tsParticles.loadFromArray(
"tsparticles",
[
{
/* options here */
},
{
/* other options here */
},
],
1
); //the second one
// Important! If the index is not in range 0...<array.length, the index will be ignored.
// after initialization this can be used.
/* tsParticles.setOnClickHandler(@callback); */
/* this will be fired from all particles loaded */
tsParticles.setOnClickHandler((event, particles) => {
/* custom on click handler */
});
// now you can control the animations too, it's possible to pause and resume the animations
// these methods don't change the config so you're safe with all your configurations
// domItem(0) returns the first tsParticles instance loaded in the dom
const particles = tsParticles.domItem(0);
// play will start the animations, if the move is not enabled it won't enable it, it just updates the frame
particles.play();
// pause will stop the animations
particles.pause();
ng-particles
You can find the instructions here
inferno-particles
You can find the instructions here
jquery-particles
You can find the instructions here
preact-particles
You can find the instructions here
react-tsparticles
You can find the instructions here
riot-particles
You can find the instructions here
solid-particles
You can find the instructions here
svelte-particles
You can find the instructions here
particles.vue
You can find the instructions here
particles.vue3
You can find the instructions here
web-particles
You can find the instructions here
Actually an official tsParticles plugin isn't existing, but I have a collaboration with
the Premium Addons for Elementor
plugin collection.
There are some presets ready to be used in this repository, and they have also a bundle file that contains everything needed to run.
This preset loads big colored circles moving upwards on a white background.
You can find the instructions here
This preset loads colored bubbles coming from the bottom of the screen on a white background.
You can find the instructions here
This preset loads white and red confetti launched from the screen center on a transparent background.
You can find the instructions here
This preset loads a faded red to black background with particles colored like fire and ash sparks.
You can find the instructions here
This preset loads a mouse trail made with small fading particles like little fireflies.
You can find the instructions here
This preset loads a beautiful fireworks effect.
You can find the instructions here
You can find the instructions here
You can find the instructions here
You can find the instructions here
You can find the instructions here
You can find the instructions here
You can find the instructions here
You can find some tsParticles related templates here. The templates are created for Vanilla Javascript, ReactJS, VueJS, Angular, SvelteJS and other frameworks.
The templates will vary, new ones can be created or older ones updated with latest features or changed to a better style. Check them out once in a while.
If you created some good design with tsParticles feel free to submit a pull request with your cool template, you'll be credited as the template author!
https://github.com/tsparticles/templates
https://particles.js.org/samples
Don't click! DON'T CLICK! OH NO IT'S SPREADING!!!!
COVID-19 is a serious disease. Please stay at home, wear a mask and stay safe!
particles.json
You can find some config samples here 📖
You can find all options available here 📖
I've created a tsParticles collection on CodePen 😮 or you can checkout my profile
Otherwise there's the demo page link below. Just click/tap the Coronavirus below, don't be scared. It's safe 😷.
Want to see ever more demos? Clone the repository on your computer and follow these instructions
yarn install && yarn start
Boom! 💥 http://localhost:3000 and you can checkout other demos.
If you are brave enough you can switch to the dev
branch for trying the features under development.
tsParticles library is fully compatible with the particles.js configuration.
Seriously, you just need to change the script source et-voilà, you're ready 🧙!
You can read more here
Want to know 5 reasons to do the switch? Read here
Below you can find all the information you need to install tsParticles and its new syntax.
tsParticles now supports some customizations 🥳.
You can create your own plugins
Read more here...
FAQs
Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.
The npm package tsparticles receives a total of 40,219 weekly downloads. As such, tsparticles popularity was classified as popular.
We found that tsparticles demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.